<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<link rel="stylesheet" type="text/css" href="main.css" />
<title>Librarian's Page</title>
<script type="text/javascript">
	function submitForm(form, action, result) {
		var barcode = document.forms[form].elements["barcode"].value;
		var userId = document.forms[form].elements["userId"].value;
		var xmlHttp = new XMLHttpRequest();
		xmlHttp.open("GET", "issue?action=" + action + "&userId=" + userId
				+ "&barcode=" + barcode, false);
		xmlHttp.send();
		var text = xmlHttp.responseText;
		document.getElementById(result).innerHTML = text;
	}
</script>
</head>
<body>
	<%@include file="header.jsp"%>
	<article>
	<form id="form1">
		Issue Book: <br /> Barcode: <input id="barcode" type="text">
		User Id: <input id="userId" type="text">
		<p id="result1"></p>
	</form>
	<button type="button" onclick='submitForm("form1", "issue", "result1")'>Submit</button>
	<br />
	<br />
	<form id="form2">
		Return Book: <br /> Barcode: <input id="barcode" type="text">
		User Id: <input id="userId" type="text">
		<p id="result2"></p>
	</form>
	<button type="button"
		onclick='submitForm("form2", "release", "result2")'>Submit</button>
	<br />
	<br />
	<a href="addBook">Add new Book</a>
	<br />
	<a href="addUser">Add a new User</a>
	<br />
	<a href="reservations">View Reservations</a>
	<br />
	</article>
	<%@include file="footer.jsp"%>
</body>
</html>